export {};

//object 对象

//object     Object

// let obj1: Object = {};
// let obj1: Object = new Object();

//报错
// let obj1: Object = 100;

//ts中的 object
let obj1: object = {};

//常用的定义对象类型
let person1: { name: string; age?: number } = {
  name: "jshand",
  age: 18,
};

//？  表示属性 可选  [key: string]  索引属性
let person2: {
  name: string;
  age?: number;
  [key: string]: any; // 索引签名，完全可以不⽤key这个单词，换成其他的也可以
};

person2 = {
  name: "jshand",
  age: 18,
};
person2 = {
  name: "jshand",
  age: 18,
  address: "黑龙江",
};
person2 = {
  name: "jshand",
  age: 18,
  address: "黑龙江",
  dsasfddsaf: 100,
  aaaa: 18,
};
